package cn.wsalix.shop.type;

public enum ProductTypeEnum {
	unknown("0", "未定"), shop("admin/shop", "商品"), order("admin/product", "订单"), store(
			"admin/brand", "品牌");
	private String code;
	private String title;

	ProductTypeEnum(String code, String title) {
		this.code = code;
		this.title = title;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public static ProductTypeEnum findByCode(String code) {
		for (ProductTypeEnum userKind : ProductTypeEnum.values()) {
			if (userKind.getCode().equals(code)) {
				return userKind;
			}
		}
		return null;
	}

}
